package com.java1412.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author java1412
 * @since 2023-06-07 15:47:21
 */
@RestController
public class ServiceZipkinController {
    @Resource
    private RestTemplate restTemplate;

    @RequestMapping(value = "/hi")
    public String callHome() {
        System.out.println("calling trace service-zipkin");
        return restTemplate.getForObject("http://localhost:8989/miya", String.class);
    }

    @RequestMapping(value = "/info")
    public String info() {
        System.out.println("calling trace service-hi");
        return "I'm service-hi";
    }
}
